import request from '@/utils/request'

// 查询表字段信息列表
export function selectTableFields(query) {
  return request({
    url: '/conf/SysTableField/selectTableFields',
    method: 'get',
    params: query
  })
}
// 查询表字段信息列表
export function selectTableNameList(query) {
  return request({
    url: '/conf/SysTableField/selectTableNameList',
    method: 'get',
    params: query
  })
}
// 查询表字段信息列表
export function selectSysTableFieldByTableId(query) {
  return request({
    url: '/conf/SysTableField/selectSysTableFieldByTableId',
    method: 'get',
    params: query
  })
}
// 查询表字段信息列表
export function selectTableListFields(query) {
  return request({
    url: '/conf/SysTableField/selectTableListFields?tableNameArr='+query,
    method: 'get',
    // params: query
  })
}
// 查询表字段信息列表
export function listSysTableField(query) {
  return request({
    url: '/conf/SysTableField/list',
    method: 'get',
    params: query
  })
}
// 查询表字段信息列表
export function selectFields(query) {
  return request({
    url: '/conf/SysTableField/selectFields',
    method: 'get',
    params: query
  })
}
// 查询表字段信息详细
export function getSysTableField(id) {
  return request({
    url: '/conf/SysTableField/' + id,
    method: 'get'
  })
}

// 新增表字段信息
export function addSysTableField(data) {
  return request({
    url: '/conf/SysTableField',
    method: 'post',
    data: data
  })
}
// 新增表字段信息
export function getSqlFromGpt(data) {
  return request({
    url: '/openAI/BiZhiPuApi/getSqlFromGpt',
    method: 'post',
    data: data
  })
}
// 新增表字段信息
export function addFieldList(data) {
  return request({
    url: '/conf/SysTableField/addFieldList',
    method: 'post',
    data: data
  })
}

// 修改表字段信息
export function updateSysTableField(data) {
  return request({
    url: '/conf/SysTableField',
    method: 'put',
    data: data
  })
}

// 删除表字段信息
export function delSysTableField(id) {
  return request({
    url: '/conf/SysTableField/' + id,
    method: 'delete'
  })
}
